package net.xdclass.manager.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;
import net.xdclass.manager.AccountManager;
import net.xdclass.mapper.AccountMapper;
import net.xdclass.model.AccountDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ：zhouyang
 * @date ：Created in 2022/4/29 8:44
 * @modified By：
 * @version: $
 */
@Slf4j
@Component
public class AccountManagerImpl implements AccountManager {
    @Autowired
    private AccountMapper accountMapper;

    @Override
    public int insert(AccountDO accountDO) {

        return accountMapper.insert(accountDO);
    }

    @Override
    public List<AccountDO> findByphone(String phone) {
        List<AccountDO> accountDOList = accountMapper.selectList(new QueryWrapper<AccountDO>().eq("phone", phone));
        return accountDOList;
    }
}
